package com.ssy.lingxi.purchase.model.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

/**
 *  配送方式枚举
 * @author 万宁
 * @version 2.0.0
 * @date 2021-05-25
 */
public enum DeliveryMethodEnum {

    /**
     * 配送方式:
     *    1、物流
     *    2、自提
     *    3、无需配送
     */

    /**
     * 1: 物流
     */
    logistics(1, "物流"),

    /**
     * 2: 自提
     */
    SELF_MENTION(2, "自提"),

    /**
     * 3: 无需配送
     */
    NO_DELIVERY_REQUIRED(3, "无需配送");

    DeliveryMethodEnum(Integer code, String msg) {
        this.code = code;
    }

    private final Integer code;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return LanguageHolder.getName(this.getClass(), this.getCode());
    }

    public static String getCodeMsg(Integer code) {
        return LanguageHolder.getName(DeliveryMethodEnum.class, code);
    }
}
